//
//  ViewController.m
//  ColorChanger
//
//  Created by iD Student on 6/24/13.
//  Copyright (c) 2013 iD Student. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)changeBackgroundColor: (id)sender
{
    UIButton *buttonPressed = (UIButton*)sender;
    if (buttonPressed == redButton)
    {
        [self.view setBackgroundColor: [UIColor redColor]];
        colorLabel.text = @"The color is red";
    }
    else if (buttonPressed == greenButton)
    {
        [self.view setBackgroundColor: [UIColor greenColor]];
        colorLabel.text = @"The color is green";
    }
    else if (buttonPressed == blueButton)
    {
        [self.view setBackgroundColor: [UIColor blueColor]];
        colorLabel.text = @"The color is blue";
    }
}

@end
